# 简单修饰器
print("-" * 50, "不使用修饰器", "-" * 50)
def sleep():
    print("睡眠中。。。。。。")
# 不采用修饰器
print("开始睡觉")
sleep()
print("起床了")


print("-" * 50, "使用修饰器", "-" * 50)
# 采用装饰器
def outer(func):
    def inner():
        print("开始睡觉")
        func()
        print("起床了")
    return inner
fn = outer(sleep)
fn()


print("-" * 50, "修饰器的另外一种写法", "-" * 50)
@outer
def sleep1():
    print("睡眠中。。。。。。")
sleep1()